﻿using UnityEngine;
using System.Collections;

public class MapMove : MonoBehaviour {

	public Transform player;
	private Vector3 startPosPlayer;
	private Vector3 startPosMap;
	public float moveScall = 0.1f;

	// Use this for initialization
	void Start () 
	{
		startPosPlayer = player.position;
		startPosMap = transform.position;
	}
	
	// Update is called once per frame
	void Update ()
	{
		if(player==null)return;
		Vector3 offset = player.position - startPosPlayer;
		transform.position = startPosMap - offset * moveScall;
	}
}
